<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="en" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
 
    <!-- blueprint CSS framework -->
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
    <!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/votehome-m.css" media="screen and (max-width:568px)"/>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/votehome-w.css" media="screen and (min-width:600px)"/>

    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-1.7.2.min.js"></script> 

    <title><?php echo CHtml::encode($this->pageTitle); ?></title>    
</head>

<body>

<div class="container" id="page">
    <a href="/" id="headurl">
        <div id="header"> 
        </div><!-- header --> 
    </a>
    <div id="headers">
            <div id="logo"><img src="images/m/back.png" border="0" onclick="javascript:window.history.back();"><span class="logotitle">投票</span></div>
    </div><!-- header --> 
<div id="mainmenu">
 <div style="text-align:center"><a href="<?php echo Yii::app()->createUrl('vote/notice');?>" style="font-size:1.6em" target="_blank">曲江新区2013第二届导游讲解员大赛网络投票说明</a></div>
</div> 
<div id="showContent">
    <div id="content"> 
    <?php foreach($dataProvider as $v){ ?>
        <div class="showimage"> 
              <div style="position: absolute;"><a href="<?php echo Yii::app()->createUrl('vote/info&id='.$v['id']);?>"><img src="<?php echo Yii::app()->baseUrl.$v['thumbnail'] ?>" class="showimg" /></a></div>
              <div style="position : relative"> 
                 <div class="shownum" id="showpoll<?php echo $v['id'] ?>"><?php echo $v['poll'] ?>票</div>
                 <div class="showmask"></div>
                  <div class="showinfo">
                    <span class="name">
                        <span class="numbers"><?php echo $v['numbers'] ?>号</span>
                        <br>
                        <span class="title">姓名:<?php echo $v['title'] ?></span>
                        <br>
                        <span class="befrom">景区:<?php echo $v['befrom'] ?></span>
                    </span>
                    <span class="vote" onclick="updatePoll(<?php echo $v['id'] ?>);">
                        <img src="images/w/poll-small.png" style="margin-left: 18px;"  id="pullimg_<?php echo $v['id'] ?>"/>
                        <br>
                        <span id="toup" style="margin-left: 18px;">投票</span>
                    </span>
                </div>
              </div> 
        </div>  
    <?php }?>

    </div><!-- content -->
</div>  

 

    <div class="clear"></div>
  <!--   <div id="showCaptcha"></div> -->

    <div id="footer">
        主办单位： 曲江新区管理委员会<Br>
        协办单位： 西安曲江文化旅游股份有限公司<br>
        技术支持： 西安有道软件技术有限公司<br><br>
        <img src="images/logo.png" border=0 id="footimg">       
        <br><br>
        <script type="text/javascript">
            function getVoide(objName){
                var arrStr = document.cookie.split(";"); 
                for(var i = 0;i < arrStr.length;i ++){ 
                    var temp = arrStr[i].split("="); 
                    if(temp[0] == objName) return unescape(temp[1]);  
               } 
               return ""; 
            }
            var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
            document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F202fabbe66a9248b12d2feb9e9e9c61b' type='text/javascript'%3E%3C/script%3E")); 
            if(getVoide("vote2013")==""){
                var exp = new Date();
                exp.setTime(exp.getTime() + 30*24*60*60*1000);  
                document.cookie ="vote2013="+ escape ("vote2013_"+new Date().getTime()) + ";expires=" + exp.toGMTString();
            } 
        </script> 
    </div><!-- footer -->

</div><!-- page -->
   <!-- 弹出层 -->
    <div id='pop-div' style="width: 300px" class="pop-box" > 
        <h4>请输入验证码<span class="closespan">[×]</span></h4> 

        <div class="pop-box-body" > 
        <p id="viewcapthca"> 
            <?php $this->widget('CCaptcha',array('id'=>'captcha_id','buttonLabel'=>'点击刷新验证码')); ?>
            <br>
            <input type="text" name="capthca" id="capthcavalue"> 
            <input type="hidden" name="userid" id="userid"> 
            <!-- <input type="text" name="userid" id="userid">  -->
        <input value="提交" id="btn1" onclick="subbtn();" type="button" /> 
        </p> 
        </div>  
    </div>
    <!-- 遮罩层 -->
    <div id="fade" class="black_overlay"></div> 
    <style type="text/css">
    .pop-box { 
        z-index: 9999; /*这个数值要足够大，才能够显示在最上层*/ 
        margin-bottom: 3px; 
        display: none; 
        position: absolute; 
        background: #FFF; 
        border:solid 1px #6e8bde; 
    } 

    .pop-box h4 { 
        color: #FFF; 
        cursor:default; 
        height: 18px; 
        font-size: 14px; 
        font-weight:bold; 
        text-align: left; 
        padding-left: 8px; 
        padding-top: 4px; 
        padding-bottom: 2px; 
        background-color: #6e8bde; 
        margin-bottom: 0.8em;
    } 
    #btn1{
        margin-top: 10px;
        width: 80px;
        height: 29px;
        background-color: #ec6a00;
        color: #ffffff;
        text-align: center;
        font-size: 20px;
        border: 0;
    }

    .pop-box-body { 
        clear: both; 
        margin: 4px; 
        padding: 2px; 
    }
    .pop-box-body p{
        margin: 0px;
        text-align: center;
    }
    .black_overlay{
        display: none;
        position: absolute;
        top: 0%;
        left: 0%;
        width: 100%;
        height: 100%;
        background-color: black;
        z-index:1001;
        -moz-opacity: 0.6;
        opacity:.60;
        filter: alpha(opacity=60);
    }
    .closespan{
        float: right;
        padding-right: 10px;
        font-size: 1.3em;
        margin-top: -5px;
    }
    </style>
    <script type="text/javascript">

         function updatePoll(id){  
         $('#pullimg_'+id).attr('src','images/w/poll-small-down.png');   
              popupDiv($("#pop-div")); 
              $("#userid").val(id); 
          }  
          
          //弹出层
          function popupDiv(obj){
              //显示遮罩层 
            document.getElementById("fade").style.display='block' ;
            var bgdiv = document.getElementById("fade");
            bgdiv.style.width = document.body.scrollWidth; 
            $("#fade").height($(document).height()); 

             $(obj).show();
             center(obj);
             $(window).scroll(function(){
                center(obj);
             });
             $(window).resize(function(){
                 center(obj);
             }); 
            }

            function center(obj){
                 var windowWidth = document.documentElement.clientWidth;   
                 var windowHeight = document.documentElement.clientHeight;   
                 var popupHeight = $(obj).height();   
                 var popupWidth = $(obj).width();    
                 $(obj).css({   
                  "position": "absolute",   
                  "top": (windowHeight-popupHeight)/2+$(document).scrollTop(),   
                  "left": (windowWidth-popupWidth)/2   
                  
                 });  
            }
 
           //关闭弹出的验证码
           
           $(".closespan").live('click',function(){
             var  id= $("#userid").val();
              $("#fade").hide(); 
               $("#pop-div" ).hide(); 
               $('#pullimg_'+id).attr('src','images/w/poll-small.png');
           });
           //填写验证码,并提交
            function subbtn() { 
                $("#fade").hide(); 
                $("#pop-div").hide(); 
                if($("#capthcavalue").val()==''){
                     alert("请输入验证码!");
                }else{
                  var capthcavalue= $("#capthcavalue").val();
                  var  id= $("#userid").val();
                     $.post('<?php echo Yii::app()->createUrl("vote/addpull");?>',{'id':id,'cookies':getVoide("vote2013"),'capthcavalue':capthcavalue},
                        function(result){ 
                        if(result.code==0){
                            alert(result.message);
                            $('#showpoll'+id).html(result.poll+"票");
                        }else{
                            if(result.code!=-3){
                                alert(result.message); 
                                $('#pullimg_'+id).attr('src','images/w/poll-small.png');
                            }
                        }
                       $("#capthcavalue").val("");
                       $("#userid").val("");
                       $('#captcha_id_button').click();
                    },'json'); 
                }
               
            }
    </script>
</body>
</html>


 
